package common

import (
	"fmt"
	db "hulk-api/databases"
)

type Host struct {
	Name string			`json:"name"`
	IpList string 		`json:"iplist"`
}

func (h *Host) GetHost() (  err error) {
	row := db.SqlDB.QueryRow("select ips from hosts where item=?" , h.Name)
	if err =row.Scan(&h.IpList); err != nil{
		fmt.Printf("scan failed, err:%v",err)
		return
	}
	return
}
